{% extends 'base.html' %}
{% block title %}首页{% endblock %}
{% block content %}
 <form class="layui-form layui-form-pane" action="" method="post">

  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">文本</label>
    <div class="layui-input-block">
      <textarea name="desc" placeholder="请输入内容" class="layui-textarea">{{ data }}</textarea>
	    {% csrf_token %}
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
</form>

<script>
//Demo
layui.use('form', function(){
  var form = layui.form;

  //监听提交
  form.on('submit(formDemo)', function(data){
    return true;
  });
});
</script>
{% endblock %}